package com.example.klaraservice.dao;

import com.example.klaraservice.pojo.Address;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : Glacialerisa
 * @date : 2023/5/28 15:59
 * @desc :
 */
@Mapper
public interface AddressMapper {
    /**
     * 获取用户的所有地址
     * @param userId
     * @return
     */
    public List<Address> selectAllAddressByUserId(int userId);

    /**
     * 获得某一地址
     * @param id
     * @return
     */
    public Address selectAddressById(int id);

    /**
     * 添加新地址
     * @param address
     * @param userId
     * @return
     */
    public boolean addAddress(@Param("address") Address address, int userId);

    /**
     * 修改地址
     * @param address
     * @return
     */
    public boolean updateAddress(Address address);

    /**
     * 删除地址
     * @param id
     * @return
     */
    public boolean deleteAddressById(int id);
}
